import { Spin } from 'antd'
import React from 'react'

export default function Loading(props) {
  // Suspense 包裹每个组件，防止懒加载闪烁
  return (
    <React.Suspense
      fallback={
        <Spin
          style={{
            top: '45%',
            left: '50%',
            position: 'absolute',
          }}
          size="large"
        />
      }>
      {props.element}
    </React.Suspense>
  )
}
